<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('学生列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('wstudy:student:edit')}]];
    var removeFlag = [[${@permission.hasPermi('wstudy:student:remove')}]];
    var poorDatas = [[${@dict.getType('wst_student_poor')}]];
    var specialtypeDatas = [[${@dict.getType('wst_student_specialtype')}]];
    var prefix = ctx + "wstudy/student";
    let postId = [[${postId}]];
    let status = "ON"
    $(function() {
        var options = {
            url: prefix + "/list/"+postId+"/0"+"/"+status,
            exportUrl: prefix + "/export",
            modalName: "学生",
            columns: [{
                checkbox: true
            },
                {
                    field: 'studentId',
                    title: 'ID',
                    visible: false
                },
                {
                    field: 'postId',
                    title: 'postId',
                    visible: false
                },
                {
                    field: 'loginName',
                    title: '登录名称',
                },
                {
                    field: 'userName',
                    title: '名称',
                },
                {
                    field: 'poor',
                    title: '贫困等级',
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(poorDatas, value);
                    }
                },
                {
                    field: 'specialtype',
                    title: '特殊群体类型',
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(specialtypeDatas, value);
                    }
                },
                {
                    field: 'credit',
                    title: '信用分'
                },
                {
                    field: 'deductpoints',
                    title: '扣分'
                },
                {
                    field: 'status',
                    title: '状态',
                    visible: false
                },
                {
                    field: 'profession',
                    title: '专业'
                },
                {
                    field: 'grade',
                    title: '班级'
                },
                {
                    field: 'bankCard',
                    title: '银行卡'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-info btn-xs " href="javascript:void(0)" onclick="details(\'' + row.studentId + '\')"><i class="fa fa-search"></i>详情</a> ');
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.editTab(\'' + row.studentId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.studentId + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });
    function details(id) {
        $.modal.openTab("详情",prefix+"/details/"+id);
    }
</script>
</body>
</html>